let html = ''
let arr = []
$.ajax({
    url: 'http://chst.vip:1234/api/getcategorytitle',
    success(res) {
        res.result.forEach((item, index) => {
            html += `<div class='contentsingle' num='${index}'>
                <div class='singledispaly' >
                    <span>${item.title}</span>
                    <p>▼</p>
                </div>
                <div class='singlehidden clear' >           
                </div>    
            </div>`


        });
        $('.content').html(`${html}`)
    }
}).then((res) => {
    $('.contentsingle').click(function () {
        $(this).children('.singlehidden').toggle(500)
        that=$(this)
        console.log($(this).attr('num'));
        $.ajax({
            url: 'http://chst.vip:1234/api/getcategory',
            data: {
                'titleid':  $(this).attr('num')
            },
            success(value) {
                console.log(value);
                var html2 = ''
                value.result.forEach((item, index) => {
                    html2 += `<a href='bijia.html?title=${item.category}&categoryid=${item.categoryId}'>${item.category}</a> `
                })
               that.children('.singlehidden').html(`${html2}`)               
            }
        })
    })
})
$('.footrow>a:nth-last-of-type(1)').click(function (e) {
e.preventDefault()
$('html,body').animate({
    scrollTop: 0
},1500)
})